package br.com.snemobile.activity;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import br.com.snemobile.R;

public class OpenMessageActivity extends Activity{

	private WebView webView;
	 
	public void onCreate(Bundle savedInstanceState) {
	   super.onCreate(savedInstanceState);
	   setContentView(R.layout.mensagem_webview);
 
	   String mime = "text/html";
	   String encoding = "utf-8";
	   String titulo = null;
	   String conteudo = null;
	   
	   Bundle extras = getIntent().getExtras();
	   if(extras != null){
		   titulo = (String) extras.get("titulo");
		   conteudo = (String) extras.get("conteudo");
	   }else{
		   conteudo = "";
	   }
	   
	   String customHtml = conteudo;
	   
	   webView = (WebView) findViewById(R.id.webView);
	   webView.getSettings().setJavaScriptEnabled(true);
	   
	   webView.loadData(customHtml, mime, encoding);
//	   webView.loadDataWithBaseURL(null, conteudo, mime, encoding, null);
 
//			   "<html>" +
//			   "	<body>" +
//			   "		<h1> " + titulo + "</h1><br>" +
//			   "		<h2> " + conteudo + "</h2>" +
//			   "	</body>" +
//			   "</html>";
	}
	
	
}
